<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAutoridad extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('autoridad', function (Blueprint $table) {
            $table->increments('id_autoridad');
            $table->string('titulo',30);
            $table->string('nombre_completo',50);
            $table->string('contacto',50);
            $table->integer('id_localidad')->nullable();

            //            $table->primary('id_autoridad');
            $table->foreign('id_localidad')->references('id_localidad')->on('localidad');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('autoridad');
    }
}
